home *** CD-ROM | disk | FTP | other *** search
-
-
-
- mmmmddddOOOOppppeeeennnnIIIInnnnPPPPoooorrrrtttt((((3333ddddmmmm)))) mmmmddddOOOOppppeeeennnnIIIInnnnPPPPoooorrrrtttt((((3333ddddmmmm))))
-
-
-
- NNNNAAAAMMMMEEEE
- mdOpenInPort, mdOpenOutPort, mdClosePort, mdGetFd - open and close
- MDports
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////mmmmiiiiddddiiii....hhhh>>>>
-
- MMMMDDDDppppoooorrrrtttt mmmmddddOOOOppppeeeennnnIIIInnnnPPPPoooorrrrtttt((((cccchhhhaaaarrrr ****nnnnaaaammmmeeee))))
- MMMMDDDDppppoooorrrrtttt mmmmddddOOOOppppeeeennnnOOOOuuuuttttPPPPoooorrrrtttt((((cccchhhhaaaarrrr ****nnnnaaaammmmeeee))))
- iiiinnnntttt mmmmddddCCCClllloooosssseeeePPPPoooorrrrtttt((((MMMMDDDDppppoooorrrrtttt ppppoooorrrrtttt))))
- iiiinnnntttt mmmmddddGGGGeeeettttFFFFdddd((((MMMMDDDDppppoooorrrrtttt ppppoooorrrrtttt))))
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- mmmmddddOOOOppppeeeennnnIIIInnnnPPPPoooorrrrtttt and mmmmddddOOOOppppeeeennnnOOOOuuuuttttPPPPoooorrrrtttt create an MDport for a specified
- interface. An MDport maintains the state of the communications path
- between the application and a MIDI interface. An MDport is passed as the
- first argument to most MIDI library routines.
-
- The _n_a_m_e parameter contains the name of the MIDI interface to which the
- newly opened port is connected. The mmmmddddGGGGeeeettttNNNNaaaammmmeeee((((3333ddddmmmm)))) function returns
- strings which can be used as valid values of _n_a_m_e. If NULL is passed in
- for name, the default MIDI interface will be opened.
-
- When a port is first opened, its default stamp mode is MD_DELTASTAMP and
- the origin of the port is set to the time at which it was opened (see
- mmmmddddSSSSeeeettttSSSSttttaaaarrrrttttPPPPooooiiiinnnntttt((((3333ddddmmmm))))). If the application changes the stamp mode to one
- of the tick modes (either MD_RELATIVETICK or MD_DELTATICK), the port will
- use a default tempo of 500000 and a default division of 384. However, an
- application should explicitly set any port parameters it depends on
- rather than depending on the default values.
-
- mmmmddddCCCClllloooosssseeeePPPPoooorrrrtttt closes the connection to the MIDI interface and frees all
- resources associated with the connection. When a port is closed, all
- events that have been queued but not yet transmitted are discarded. As a
- result, the application may need to insure that all desired events have
- been transmitted before closing the port. One way the application can do
- this is for it to wait until mmmmddddTTTTeeeellllllllNNNNoooowwww((((3333ddddmmmm)))) returns the stamp of the last
- transmitted event.
-
- The application must call mmmmddddIIIInnnniiiitttt((((3333ddddmmmm)))) before calling either mdOpenInPort
- or mdOpenOutPort. Failing to do so will produce indeterminant results.
-
- mmmmddddGGGGeeeettttFFFFdddd returns a file descriptor that an application can use to
- construct the arguments for a sssseeeelllleeeecccctttt((((2222)))) or ppppoooollllllll((((2222)))) call. These calls are
- used when the application wants to give up control of the CPU (letting
- other processes use the CPU) until a port becomes ready for input or
- output. MIDI input ports are considered to be ready when one or more
- events are available for reception. Output ports are ready when they are
- capable of accepting additional events. Once a port becomes ready,
- select and poll return, and the application can continue processing.
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- mmmmddddOOOOppppeeeennnnIIIInnnnPPPPoooorrrrtttt((((3333ddddmmmm)))) mmmmddddOOOOppppeeeennnnIIIInnnnPPPPoooorrrrtttt((((3333ddddmmmm))))
-
-
-
- When using select, an input port's file descriptor is used in a read
- fdset and an output port's file descriptor is used in a write fdset.
-
- When using poll, an input port's file descriptor is used with the POLLIN
- event flag and an output port's file descriptor is used with a POLLOUT
- event flag.
-
- mdGetFd should only be used in select or poll; the results of passing it
- as an argument to any other system calls are undefined.
-
- RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
- mdOpenInPort and mdOpenOutPort return an MDport on success or NULL in
- event of failure. mdClosePort returns 0 on success and -1 on failure.
- On an error, errno will be set to one of the following:
-
- ENOMEM - No memory was available for the MDport data structure
-
- ENODEV - The MIDI driver wasn't present
-
- EINVAL - An undefined operation was called.
-
- mdGetFd returns a file descriptor. On an error it returns -1.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- mmmmddddIIIInnnnttttrrrroooo((((3333ddddmmmm)))), mmmmddddSSSSeeeettttSSSSttttaaaammmmppppMMMMooooddddeeee((((3333ddddmmmm)))), mmmmddddGGGGeeeettttNNNNaaaammmmeeee((((3333ddddmmmm)))), mmmmddddTTTTeeeellllllllNNNNoooowwww((((3333ddddmmmm)))),
- mmmmddddSSSSeeeettttSSSSttttaaaarrrrttttPPPPooooiiiinnnntttt
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-